<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>圣杯布局</title>
    <style>
        body {
            height: 95vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        header {
            height: 5vh;
            text-align: center;
            padding-top: 2.5vh;
            background-color: red;
        }

        section {
            flex: 1;
            display: flex;
            flex-direction: row;
        }

        .main {
            flex: 1;
            background-color: lightskyblue;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .right {
            background-color: #ff9595;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .left {
            /*排序*/
            order: -1;
            background-color: yellow;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .right, .left {
            flex: 0 0 200px;
        }

        footer {
            height: 5vh;
            text-align: center;
            padding-top: 2.5vh;
            background-color: green;
        }

        @media (max-width: 768px) {
            section{
                flex-direction: column;
                flex: 1;
            }
            .main{
                flex: 1;
            }
            .left,.right{
                flex: 0 0 200px;
            }
        }
    </style>
</head>
<body>
<header>头头是道</header>
<section>
    <!--    main放第一个，浏览器可以第一个渲染到-->
    <div class="main">主要内容</div>
    <div class="left">虚左以待</div>
    <div class="right">无出其右</div>
</section>
<footer>海底捞月</footer>
</body>
</html>